package com.itheima.utils;

/*
    包装ThreadLocal的工具类
 */
public class BaseContext {

    //1. 创建ThreadLocal
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //2. 提供存值的方法
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    //3. 提供取值的方法
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
